Public Class frmProgress
    Dim _totalRead As Long
    Dim _totalLen As Long
    Private Sub frmProgress_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If Not Owner Is Nothing Then
            Me.Owner.Enabled = True
        End If
    End Sub

    Private Sub frmProgress_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        Dim CenterPoint As New Point
        If Owner Is Nothing Then
            CenterPoint.X = ((My.Computer.Screen.WorkingArea.Width - Me.Width) / 2)
            CenterPoint.Y = ((My.Computer.Screen.WorkingArea.Height - Me.Height) / 2)
        Else
            Me.Owner.Enabled = False
            CenterPoint.X = Me.Owner.Location.X + ((Me.Owner.Width - Me.Width) / 2)
            CenterPoint.Y = Me.Owner.Location.Y + ((Me.Owner.Height - Me.Height) / 2)
        End If
        Me.Location = CenterPoint
    End Sub

    Public Property Progress() As Integer
        Get
            Return barProgress.Value
        End Get
        Set(ByVal value As Integer)
            barProgress.Value = value
            Application.DoEvents()
        End Set
    End Property
    Public Property Maximum() As Integer
        Get
            Return barProgress.Maximum
        End Get
        Set(ByVal value As Integer)
            barProgress.Maximum = value
            Application.DoEvents()
        End Set
    End Property

    Public Property Status() As String
        Get
            Return gPanel.Text
        End Get
        Set(ByVal value As String)
            gPanel.Text = value
        End Set
    End Property

    Public Property ProgressIcon() As System.Drawing.Bitmap
        Get
            Return gPanel.Icon
        End Get
        Set(ByVal value As System.Drawing.Bitmap)
            gPanel.Icon = value
            gPanel.Invalidate()
        End Set
    End Property

    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub

    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Me.ShowInTaskbar = False
    End Sub
    Sub CopyProgress(ByVal Read As Long)
        _totalRead += Read
        Progress = (_totalRead / _totalLen) * 100
    End Sub
    Public Property Fileslen() As Long
        Get
            Return _totalLen
        End Get
        Set(ByVal value As Long)
            _totalLen = value
        End Set
    End Property
End Class